<?php
echo $this->Form->create('Owner');
echo $this->Form->input("Owner.id");
echo $this->Form->input("Owner.nombres");
echo $this->Form->hidden("Owner.property_id");
echo $this->Form->input("Owner.primer_apellido");
echo $this->Form->input("Owner.segundo_apellido");
echo $this->Form->input("Owner.documento");

?>
<?php
echo $this->Ajax->observeField('OwnerDepartamentId', array(
    'url' => array('action' => 'select'),
    'frequency' => 0.2,
    'update' => 'ciudades'
        )
);
?>
<?php echo $this->Form->input('Owner.departament_id', array('label' => 'Departamento', 'empty' => 'Seleccione departamento', 'value' => $this->data['Departament']['id'])); ?>

<div id="ciudades">
    <?php echo $this->Form->input('Owner.city_id', array('label' => 'Municipio', 'class' => '')); ?>
</div>

<?php
echo $this->Ajax->submit('Guardar', array('url' => array('controller' => 'owners', 'action' => 'edit', $this->data['Owner']['id']), 'update' => 'content', 'complete' => 'cargar()', 'indicator' => 'loading'));
echo $this->Form->end();
?>
<?php
    echo $this->Ajax->link($this->Html->image('regresar.gif', array('width' => '30', 'heigth' => '30', 'alt' => 'Regresar', 'title' => 'regresar')), array('controller' => 'owners',$this->data['Owner']['property_id'], 'action' => 'index'), array('update' => 'content', 'indicator' => 'loading', 'escape' => false));
?>
